<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <link rel="stylesheet" href="../css/cost.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="title">
        <em></em>
        <h3>费用明细</h3>
    </div>
    <!--<form class="layui-form layui-form-padding" action="">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="modules" lay-search="">
                    <option value="">全部</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="operation" lay-search="">
                    <option value="">操作</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">查询</button>
                <button type="reset" class="layui-btn layui-btn-primary">清空</button>
            </div>
        </div>
    </form>-->
    <div class="layuimini-main">
        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

    </div>
</div>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table','tfApi'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
             API = layui.tfApi;

        table.render({
            elem: '#currentTableId',
            url: API.CURL + '/invoice/qryAccountDetails',
            cellMinWidth: 60,
            method: "POST",
            contentType: 'application/json',
            xhrFields: {withCredentials: true},crossDomain: true,
            request:{
                pageName: "page",
                limitName : "pageSize"
            },
            parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.data.total, //解析数据长度
                    "data": res.data.details, //解析数据列表
                };
            },
            cols: [[
                {field: 'tradeId', title: '流水号',fixed: 'center',width:200},
                {field: 'sellerName', title: '商户名称',width:150,fixed: 'center'},
                {field: 'serviceName',  title: '服务商名称',width:150,fixed: 'center'},
                {field: 'operType', title: '收支',fixed: 'center',width:100, sort: true , templet : function (d) {
                        var str = (d.operType == '1') ? '<span>收入</span>' : '<span>支出</span>';
                        return str;
                    }},
                {field: 'tradeMoney', title: '金额',width:150, sort: true ,templet : function (d) {
                    var _s = API.numFun(d.tradeMoney);
                    return '<b>'+_s+'</b>';
                }},
                {field: 'orderSource', title: '单据来源',width:120, sort: true, templet : function (d) {
                        var str = '';
                        if(d.orderSource == '00'){str = '发放单';}
                        if(d.orderSource == '01'){str = '代理商提现单';}
                        if(d.orderSource == '02'){str = '退款单';}
                        if(d.orderSource == '03'){str = '服务费单';}
                        if(d.orderSource == '04'){str = '分佣单';}
                        if(d.orderSource == '05'){str = '充值单';}
                        if(d.orderSource == '06'){str = '系统加款';}
                        if(d.orderSource == '07'){str = '系统扣款';}
                        return str;
                    }},
                {field: 'tradeComment', title: '费用说明'},
                {field: 'totalTime', title: '完成时间',width:200, sort: true}
            ]],
            page: true,
            //skin: 'line'
        });
        //监听提交
        form.on('submit(demo1)', function (data) {


            return false;
        });

    });
</script>

</body>
</html>